 subroutine ri_symm(riin,  nmo, isymmo, isymnaux,  naux8t)
 use mod_iop
 use mod_ri
 use mod_symm
 use mod_orbit
 implicit none
 integer, intent(in) :: nmo, naux8t(8)
 integer, intent(in) :: isymmo(nmo, 8), isymnaux(naux, 8)
 
 real*8, intent(in) :: riin(naux, nmo, nmo)

 integer irrepn, irrepi, irrepj, irrepa, irrepb 
 integer irrepab, irrepij, irrepai, irrepn
 integer numi, numj, numa, numb, numij, numab, numai
 integer i, j, a, b, n, numn, idx0
 integer idxi, idxj, idxa, idxb, idxn
 integer ioff, idx, idxold, irrep
 integer ioffvv(8), ioffvo(8), ioffoo(8)
 integer itmp(naux, 8)
 integer, external :: isymoffso, irpdso
! riin为不含对称性的(n|pq)
! isymnaux(naux,8) 每个不可约表示里对应的辅助基组序数对应的不考虑对称性时候的总序数
! 设(n|pq)的对称性为1
 isymnaux(1:naux, 1:8) = 0
 do irrepn = 1, nirrep
    irrepab = irrepn
    idx0 = 0
    numn = naux
    do n = 1, numn
! 对于每一个确定的n和irrepn, 若对应的ab全部为0，则该n值不应出现在与irreppq对应的irrepn中
       idxold = 0
       do irrepb = 1, nirrep
          irrepa = dirprd(irrepb, irrepab)
          numa = vrta(irrepa)+popa(irrepa)
          numb = vrta(irrepb)+popa(irrepb)
          do b = 1, numb
          do a = 1, numa 
             idxa = isymmo(a, irrepa)
             idxb = isymmo(b, irrepb) 
             if(riin(n, idxa, idxb)>1.d-10) idxold = 1
          enddo
          enddo
       enddo
       if(idxold==1) then 
           idx0 = idx0 + 1
           isymnaux(idx0, irrepn) = n
       endif
    enddo
! 统计每个irrepn对应的idx0的数值最后发现刚好满足对称性表示。
    if(ldebug) then 
       write(6,*)'idx0', idx0 
    endif
    naux8t(irrepn) = idx0
 enddo

 return
 end 
